/*
 * @Description: 浏览记录
 * @Author: iamsmiling
 * @Date: 2021-06-13 09:07:39
 * @LastEditTime: 2021-06-13 09:51:35
 */
/*
 * @Description: 我的收藏
 * @Author: iamsmiling
 * @Date: 2021-06-13 09:01:31
 * @LastEditTime: 2021-06-13 09:05:35
 */
import 'package:credit_business_circle/R/R.dart';
import 'package:credit_business_circle/components/topic_card/topic_card.dart';
import 'package:credit_business_circle/domain/local/topic/topic_entity.dart';
import 'package:credit_business_circle/domain/remote/topic/topic_log_entity.dart';
import 'package:credit_business_circle/pages/mine/children/my_footprint/my_footprint_controller.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class MyFootprintPage extends GetView<MyFootprintController> {
  const MyFootprintPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("浏览记录"),
        elevation: .5,
      ),
      body: GetBuilder<MyFootprintController>(
        builder: (_) {
          return ListView.builder(
              padding: EdgeInsets.symmetric(horizontal: R.dimen.dp10),
              itemCount: _.list.length,
              itemBuilder: (BuildContext context, int i) {
                TopicLogEntity log = _.list[i];
                return Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Container(
                        margin: EdgeInsets.only(
                            top: R.dimen.dp20, bottom: R.dimen.dp13),
                        child: Text(
                          log.date,
                          style: TextStyle(
                              fontSize: R.dimen.sp12, color: R.color.ff666666),
                        )),

                    for (TopicEntity topic in log.topics)
                      TopicCard(
                        topic: topic,
                        borderColor: R.color.transparent,
                        margin: EdgeInsets.only(bottom: R.dimen.dp10),
                        bannerVisible: false,
                        bottomRightBuilder: (BuildContext context) =>
                            SizedBox.shrink(),
                      )
                    // Expanded(
                    //   child: AutoList(
                    //     items: log.topics,
                    //     duration: const Duration(milliseconds: 375),
                    //     itemBuilder: (BuildContext context, TopicEntity topic) {
                    //       return TopicCard(topic: topic);
                    //     },
                    //   ),
                    // )
                  ],
                );
              });
        },
      ),
    );
  }
}
